package NC103_反转字符串;

public class Solution {
    /**
     * 反转字符串
     * @param str string字符串
     * @return string字符串
     */
    public String solve (String str) {
        // write code here
        char[] arr = str.toCharArray();
        int len = str.length();
        for (int i = 0; i < len / 2; i++){
            char temp = str.charAt(i);
            arr[i] = str.charAt(len - i - 1);
            arr[len - i - 1] = temp;
        }
        return new String(arr);
    }

}